package com.lishao.soccer.action;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.lishao.soccer.bean.entity.TmTeamPlace;
import com.lishao.soccer.service.TmTeamPlaceService;
import com.lishao.system.security.providers.SecurityUser;
import com.lishao.system.utils.ActionUtil;
import com.opensymphony.xwork2.ActionSupport;

import net.sf.json.JSONObject;
import net.sf.json.JsonConfig;

public class TmTeamPlaceAction extends ActionSupport {
	TmTeamPlaceService tmTeamPlaceService;
	String jsonStr;
	
	public String saveTeamPlace() throws Exception{
		String strMessage = "";
		HttpServletRequest request = ServletActionContext.getRequest();
		HttpSession session = request.getSession();
		SecurityUser secUser = (SecurityUser)session.getAttribute("LOGIN_KEY");
		TmTeamPlace tmTeamPlace = (TmTeamPlace)JSONObject.toBean(JSONObject.fromObject(jsonStr, new JsonConfig()), TmTeamPlace.class);
		tmTeamPlace = tmTeamPlaceService.saveTeamPlace(tmTeamPlace, secUser.getSmUser());
		Map resMap = new HashMap();
		resMap.put("tmTeamPlace", tmTeamPlace);
		new ActionUtil().writeMap(resMap);
		
		return null;
	}
	//get set
	public TmTeamPlaceService getTmTeamPlaceService() {
		return tmTeamPlaceService;
	}

	public void setTmTeamPlaceService(TmTeamPlaceService tmTeamPlaceService) {
		this.tmTeamPlaceService = tmTeamPlaceService;
	}
	public String getJsonStr() {
		return jsonStr;
	}
	public void setJsonStr(String jsonStr) {
		this.jsonStr = jsonStr;
	}
}
